package com.thinkgem.dingdan.modules.bu.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.thinkgem.dingdan.common.persistence.CrudDao;
import com.thinkgem.dingdan.common.persistence.annotation.MyBatisDao;
import com.thinkgem.dingdan.modules.bu.entity.BuOrder;
import com.thinkgem.dingdan.modules.bu.entity.TotalEntity;

/**
 * @author SD
 * @version 2018-08-26
 */
@MyBatisDao
public interface BuOrderDao extends CrudDao<BuOrder> {

	/**
	 * 
	 * @param buOrder
	 * @return int
	 */
	int selectOrderStatus(BuOrder buOrder);
	
	/**
	 * 
	 * @param buOrder
	 * @return int
	 */
	int updateDelivery(BuOrder buOrder);
	
	/**
	 * 
	 * @param buOrder
	 * @return BuOrder
	 */
	BuOrder findEntity(BuOrder buOrder);
	
	/**
	 * 
	 * @param buOrder
	 * @return int
	 */
	int updateBatchReceipt(BuOrder buOrder);
	
	/**
	 * 
	 * @param buOrder
	 * @return BuOrder
	 */
	BuOrder findById(BuOrder buOrder);
	
	/**
	 * 
	 * @param buOrder
	 */
	void updateSalesNameById(BuOrder buOrder);
	
	/**
	 * 
	 * @param buOrder
	 */
	void updateCustomerNameById(BuOrder buOrder);
	
	/**
	 * 
	 * @param buOrder
	 */
	void updateSupplierNameById(BuOrder buOrder);
	
	TotalEntity findCreateById(BuOrder buOrder);
	TotalEntity findCustomerById(BuOrder buOrder);
	TotalEntity findSupplierById(BuOrder buOrder);
	TotalEntity findAllTotal(BuOrder buOrder);
	
	List<BuOrder> selectCustomerIdListByCreateId(BuOrder buOrder);
	List<BuOrder> selectCustomerIdListForManage(BuOrder buOrder);
	List<BuOrder> selectCustomerIdListBySupplierId(BuOrder buOrder);
	List<BuOrder> selectSupplierListByCreateId(BuOrder buOrder);
	List<BuOrder> selectSupplierIdListForManage(BuOrder buOrder);
	
	List<BuOrder> selectCustomerIdListByCustomerId(BuOrder buOrder);
	List<BuOrder> selectSupplierListByCustomerId(BuOrder buOrder);
	List<BuOrder> selectSupplierListBySupplierId(BuOrder buOrder);
	
	List<BuOrder> findImageList();
	
	void updateImageUrl(@Param("id") String id,@Param("picUrl") String picUrl);
	
}